package com.hp.bon.sgw.domain;

import java.util.Date;
import java.util.LinkedList;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.hp.ocs.diameter.message.dictionary.AvpType;


@Entity
@Table(name = "SGW_ROLLBACK_CFG")
public class RollbackCfg{
	private int id;
	private String requestHost;
	private String serviceContextId;
	private String rollbackServiceContextId;
	private String reqSerialPath;
	private String destinationIdPath;
	private long delaySecond;
	private long maxSendTimes;
	private Date modifiedTime;
	
	private LinkedList<AvpType> avpPath = new LinkedList<AvpType>();
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "REQUEST_HOST" , length = 64, nullable = false)
	public String getRequestHost() {
		return requestHost;
	}
	public void setRequestHost(String requestHost) {
		this.requestHost = requestHost;
	}
	
	@Column(name = "SERVICE_CONTEXT_ID" , length = 255, nullable = false)
	public String getServiceContextId() {
		return serviceContextId;
	}
	public void setServiceContextId(String serviceContextId) {
		this.serviceContextId = serviceContextId;
	}
	
	@Column(name = "ROLLBACK_SERVICE_CONTEXT_ID" , length = 255, nullable = false)
	public String getRollbackServiceContextId() {
		return rollbackServiceContextId;
	}
	public void setRollbackServiceContextId(String rollbackServiceContextId) {
		this.rollbackServiceContextId = rollbackServiceContextId;
	}
	
	
	@Column(name = "REQ_SERIAL_PATH" , length = 1000)
	public String getReqSerialPath() {
		return reqSerialPath;
	}
	public void setReqSerialPath(String reqSerialPath) {
		this.reqSerialPath = reqSerialPath;
	}
	
	
	@Column(name = "DESTINATION_ID_PATH" , length = 1000)
	public String getDestinationIdPath() {
		return destinationIdPath;
	}
	public void setDestinationIdPath(String destinationIdPath) {
		this.destinationIdPath = destinationIdPath;
	}
	
	
	@Column(name = "DELAY_SECOND", length = 10, nullable = false)
	public long getDelaySecond() {
		return delaySecond;
	}
	public void setDelaySecond(long delaySecond) {
		this.delaySecond = delaySecond;
	}
	
	@Column(name = "MAX_SEND_TIMES" , length = 10, nullable = false)
	public long getMaxSendTimes() {
		return maxSendTimes;
	}
	public void setMaxSendTimes(long maxSendTimes) {
		this.maxSendTimes = maxSendTimes;
	}
	
	@Column(name = "MODIFIED_TIME", columnDefinition = "TIMESTAMP(6)")
	public Date getModifiedTime() {
		return modifiedTime;
	}
	public void setModifiedTime(Date modifiedTime) {
		this.modifiedTime = modifiedTime;
	}
	
	@Transient
	public LinkedList<AvpType> getAvpPath() {
		return avpPath;
	}

	public void setAvpPath(LinkedList<AvpType> avpPath) {
		this.avpPath = avpPath;
	}
	
	@Override
	public String toString() {
		return "RollbackCfg [id=" + id + ", requestHost=" + requestHost + ", serviceContextId=" + serviceContextId + ", rollbackServiceContextId=" + rollbackServiceContextId + ", reqSerialPath=" + reqSerialPath + ", destinationIdPath=" + destinationIdPath + ", delaySecond=" + delaySecond
				+ ", maxSendTimes=" + maxSendTimes + ", modifiedTime=" + modifiedTime + "]";
	}
	

}
